package com.hx.jvm.jvm.oom;

import java.security.KeyStore.TrustedCertificateEntry;

/**
 * java虚拟机栈抛出OOM异常 此处代码不运行
 * <p>
 * 创建线程导致内存溢出
 *
 * @author jxrjc
 */
public class JavaVMStackOOM {

    public void createThread() {
        while (true) {
            Thread thread = new Thread(new Runnable() {

                @Override
                public void run() {
                    doOther();
                }
            });
        }
    }

    private void doOther() {
        while (true) {
            // 一直自旋
        }

    }

}
